package com.gmq.chapter01.suspend;

/**
 * Created by gmq on 2017/08/10.
 *
 * @version 1.0
 * @since 2017/08/10 14:54
 */
public class NoSameObject {
    private String username = "1";
    private String password = "11";

    public void setValue(String u, String p) {
        this.username = u;
        if (Thread.currentThread().getName().equals("a")) {
            System.out.println("停止线程a");
            Thread.currentThread().suspend();
        }
        this.password = p;
    }

    public void printUP() {
        System.out.println(this.username + " " + this.password);
    }
}
